package com.celesea.workflow.demo.entity;

import com.celesea.framework.entity.BaseEntity;
import com.celesea.framework.util.EnvUtil;
import com.celesea.framework.vo.DictionaryVo;

import javax.persistence.Column;
import javax.persistence.Table;

@Table(name = "wf_demo_perm_mapping")
public class DemoPerm extends BaseEntity {
    // 用户
    public static final Integer PERM_TYPE_USER = 1;
    // 群组
    public static final Integer PERM_TYPE_GROUP = 2;

    @Column(name = "`demo_id`", columnDefinition = "关联Id", nullable = false)
    private String demoId;
    @Column(name = "`perm_type`", columnDefinition = "授权类型", nullable = false)
    private Integer permType;
    @Column(name = "`perm_id`", columnDefinition = "授权Id", nullable = false)
    private String permId;
    @Column(name = "`perm_name`", columnDefinition = "授权名称")
    private String permName;

    public DemoPerm() {
    }

    public DemoPerm(String demoId, Integer permType, DictionaryVo item) {
        super.tenantId = EnvUtil.getTenantId();
        this.demoId = demoId;
        this.permType = permType;
        this.permId = item.getId();
        this.permName = item.getName();
    }

    public String getDemoId() {
        return demoId;
    }

    public void setDemoId(String demoId) {
        this.demoId = demoId;
    }

    public Integer getPermType() {
        return permType;
    }

    public void setPermType(Integer permType) {
        this.permType = permType;
    }

    public String getPermId() {
        return permId;
    }

    public void setPermId(String permId) {
        this.permId = permId;
    }

    public String getPermName() {
        return permName;
    }

    public void setPermName(String permName) {
        this.permName = permName;
    }
}
